﻿
Partial Class pu_pop
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim p1, rowIndex, colIndex As String
        rowIndex = CType(Request.QueryString("rowIndex"), Integer)
        colIndex = CType(Request.QueryString("colIndex"), Integer)
        p1 = Request.QueryString("p1")
        'S083343
        img.ImageUrl = getImageUrl(p1, rowIndex, colIndex) '"MAZEPC/A1/image/2B6/123.jpg"

        'Response.Write(HttpContext.Current.Server.MapPath("."))

    End Sub

    Protected Function getImageUrl(ByVal p1 As String, ByVal rowIndex As Integer, ByVal colIndex As Integer) As String
        Dim dt As Data.DataTable
        Dim row As Data.DataRow
        Dim imgStr As String
        dt = Utility.GetProdPict1(p1)
        row = dt.Rows(rowIndex)
        imgStr = row(colIndex).ToString().Trim()
        getImageUrl = String.Empty
        If Utility.Tif2JPG(imgStr) Then
            imgStr = imgStr.Substring(1).Replace("\", "/")
            getImageUrl = imgStr.ToLower().Replace("tif", "jpg")
        End If
    End Function
End Class
